$(window).scroll(function () {

    //返回顶部
    if ($(window).scrollTop() >= 200) {
        $("#back2top").css({"visibility": "visible", "opacity": "1"});
    } else {
        $("#back2top").css({"visibility": "hidden", "opacity": "0"});
    }
});